package cn.wolfcode.wolf2w.business.api.factory;

import cn.wolfcode.wolf2w.business.api.RemoteStrategyEsService;
import cn.wolfcode.wolf2w.business.api.domain.StrategyEs;
import cn.wolfcode.wolf2w.common.core.domain.R;
import org.apache.commons.compress.utils.Lists;
import org.springframework.cloud.openfeign.FallbackFactory;
import org.springframework.stereotype.Component;
import org.springframework.web.bind.annotation.RequestBody;

@Component
public class RemoteStrategyEsFallbackFactory implements FallbackFactory<RemoteStrategyEsService> {
    @Override
    public RemoteStrategyEsService create(Throwable cause) {
        return new RemoteStrategyEsService() {

            @Override
            public R<?> initStrategyEs(@RequestBody StrategyEs strategyEs, String source) {
                return R.fail("初始化攻略ES数据失败:" + cause.getMessage());

            }
        };
    }
}
